//
//  GSCommonLoginAppInfomation.m
//  GSLoginDemo
//
//  Created by guoshikeji_a on 2018/7/30.
//  Copyright © 2018年 guoshikeji. All rights reserved.
//

#import "GSCommonLoginAppInfomation.h"

#import "GSCommonLoginPrefixProfile.h"

@implementation GSCommonLoginAppInfomation

/**
 app名称
 */
+ (NSString *)appDisplayName {
    return BCLocalizedKey(@"CFBundleDisplayName");
}

/**
 当前icon的名称
 */
+ (NSString *)appIconName {
    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
    NSDictionary *bundleIcons = infoDict[@"CFBundleIcons"];
    if (bundleIcons) {
        NSDictionary *bundlePrimaryIcon = bundleIcons[@"CFBundlePrimaryIcon"];
        if (bundlePrimaryIcon) {
            NSArray *bundleIconFiles = bundlePrimaryIcon[@"CFBundleIconFiles"];
            if (bundleIconFiles.count) {
                id iconLastName = [bundleIconFiles lastObject];
                if ([iconLastName isKindOfClass:[NSString class]]) {
                    return iconLastName;
                }
            }
        }
    }
    return nil;
}

@end
